package org.zj.webview.type;

import lombok.Getter;

/**
 * @author zj
 * @since 2025/7/2
 */
@Getter
public enum LogLevel {
    NONE(0),
    TRACE(1),
    DEBUG(2),
    INFO(3),
    WARN(4),
    ERROR(5);

    private final int value;

    LogLevel(int value) {
        this.value = value;
    }

    /**
     * 根据value获取枚举
     *
     * @param value
     * @return
     */
    public static LogLevel valueOf(int value) {
        for (LogLevel level : values()) {
            if (level.value == value) {
                return level;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + value + "]");
    }
}
